﻿
/* 
 * Since 2008 - 2012
 */
package com.hh.bss.talent.entity;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import com.hh.bss.base.BaseEntity;
import com.hh.bss.util.DateConvertUtils;



public class Cv extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "Cv";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_CV_NAME = "cvName";
	public static final String ALIAS_CV_NAME_EN = "cvNameEn";
	public static final String ALIAS_NAME_INFORMER = "nameInformer";
	public static final String ALIAS_NAME_DT = "nameDt";
	public static final String ALIAS_SEX = "sex";
	public static final String ALIAS_BIRTHDAY = "birthday";
	public static final String ALIAS_MOBILE = "mobile";
	public static final String ALIAS_TEL = "tel";
	public static final String ALIAS_IM = "im";
	public static final String ALIAS_EMAIL = "email";
	public static final String ALIAS_COMPANY = "company";
	public static final String ALIAS_OLDCOMPANY= "oldcompany";
	public static final String ALIAS_DEPT = "dept";
	public static final String ALIAS_TITLE = "title";
	public static final String ALIAS_INDUSTRY = "industry";
	public static final String ALIAS_FUNCTION = "function";
	public static final String ALIAS_LEVEL = "level";
	public static final String ALIAS_MARRIED = "married";
	public static final String ALIAS_REGISTER_LOCATION = "registerLocation";
	public static final String ALIAS_ADDRESS = "address";
	public static final String ALIAS_POST_CODE = "postCode";
	public static final String ALIAS_DEGREE = "degree";
	public static final String ALIAS_WORK_YEAR = "workYear";
	public static final String ALIAS_HOME_BACK = "homeBack";
	public static final String ALIAS_INTEREST_EN = "interestEn";
	public static final String ALIAS_INTEREST = "interest";
	public static final String ALIAS_EXPECT_LOCATION = "expectLocation";
	public static final String ALIAS_RESUME_INFORMER = "resumeInformer";
	public static final String ALIAS_RESUME_DT = "resumeDt";
	public static final String ALIAS_CV_TYPE = "cvType";
	public static final String ALIAS_CV_STATUS = "cvStatus";
	public static final String ALIAS_CV_FROM = "cvFrom";
	public static final String ALIAS_CREATOR = "creator";
	public static final String ALIAS_CREATE_DT = "createDt";
	public static final String ALIAS_MODIFIER = "modifier";
	public static final String ALIAS_MODIFIED_DT = "modifiedDt";
	public static final String ALIAS_HOME_BACK_EN = "homeBackEn";
	public static final String ALIAS_LOGO = "logo";
	public static final String ALIAS_CURRENT_ADDRESS = "currentAddress";
	
	//date formats
	public static final String FORMAT_NAME_DT = DATE_TIME_FORMAT;	
	public static final String FORMAT_BIRTHDAY =SHORT_DATE_FORMAT ;//SHORT_DATE_FORMAT;
	public static final String FORMAT_RESUME_DT = DATE_TIME_FORMAT;
	public static final String FORMAT_CREATE_DT = DATE_TIME_FORMAT;
	public static final String FORMAT_MODIFIED_DT = DATE_TIME_FORMAT;
	public static Integer DELETE_FLAG=new Integer(1);
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
	
	private java.lang.Integer id;
	@NotBlank @Length(max=20)
	private java.lang.String cvName;
	@Length(max=20)
	private java.lang.String cvNameEn;
	@NotBlank @Length(max=50)
	private java.lang.String nameInformer;
	@NotNull 
	private java.util.Date nameDt;
	@NotBlank @Length(max=1)
	private java.lang.String sex;
	
	private java.util.Date birthday;
	@NotBlank @Length(max=20)
	private java.lang.String mobile;
	@Length(max=20)
	private java.lang.String tel;
	@Length(max=50)
	private java.lang.String im;
	@Email @Length(max=50)
	private java.lang.String email;
	@Length(max=100)
	private java.lang.String company;
	@Length(max=100)
	private java.lang.String oldcompany;
	@Length(max=50)
	private java.lang.String dept;
	@Length(max=50)
	private java.lang.String title;
	
	private java.lang.Integer industry;
	
	private java.lang.Integer function;
	
	private java.lang.Integer level;
	@Max(32767)
	private Integer married;
	
	private java.lang.Integer registerLocation;
	@Length(max=100)
	private java.lang.String address;
	@Length(max=6)
	private java.lang.String postCode;
	
	private java.lang.Integer degree;
	@Max(32767)
	private Integer workYear;
	@Length(max=65535)
	private java.lang.String homeBack;
	@Length(max=65535)
	private java.lang.String interestEn;
	@Length(max=65535)
	private java.lang.String interest;
	
	private String expectLocation;
	@Length(max=50)
	private java.lang.String resumeInformer;
	
	private java.util.Date resumeDt;
	@Length(max=20)
	private java.lang.String cvType;
	@Length(max=1)
	private java.lang.String cvStatus;
	@Length(max=1)
	private java.lang.String cvFrom;
	@Length(max=50)
	private java.lang.String creator;
	
	private java.util.Date createDt;
	@Length(max=50)
	private java.lang.String modifier;
	
	private java.util.Date modifiedDt;
	@Length(max=65535)
	private java.lang.String homeBackEn;
	
	@Length(max=200)
	private java.lang.String logo;
	
	@Length(max=200)
	private java.lang.String currentAddress;
	private java.lang.Integer currentSalary;
	@Length(max=50)
	private String position;
	/**简历完整度*/
	private String integrity; 
	 private java.lang.Integer isDelete=new Integer(0);
	 private java.util.Date deleteDt;
	 /**文本格式简历*/
	 private String cvText;
	 
	 /**人选附件类型  (简历 照片 证书 等)*/
	 private String cvAttachmentType; 
	 
	// private String baseCreator;
	//columns END
	 
	
	public String getCvAttachmentType() {
		return cvAttachmentType;
	}


	public void setCvAttachmentType(String cvAttachmentType) {
		this.cvAttachmentType = cvAttachmentType;
	}

	public java.util.Date getDeleteDt() {
		return deleteDt;
	}

	public String getCvText() {
		return cvText;
	}

	public void setCvText(String cvText) {
		this.cvText = cvText;
	}

	public void setDeleteDt(java.util.Date deleteDt) {
		this.deleteDt = deleteDt;
	}

	public java.lang.Integer getIsDelete() {
		return isDelete;
	}

	public void setIsDelete(java.lang.Integer isDelete) {
		this.isDelete = isDelete;
	}

	public String getIntegrity() {
		return integrity;
	}

	public void setIntegrity(String integrity) {
		this.integrity = integrity;
	}

	public String getPosition() {
		return position;
	}

	public void setPosition(String position) {
		this.position = position;
	}

	public java.lang.Integer getCurrentSalary() {
		return currentSalary;
	}

	public void setCurrentSalary(java.lang.Integer currentSalary) {
		this.currentSalary = currentSalary;
	}

	//dto
	private String industry_str;
	private String function_str;
	private String married_str;
	private String sex_str;
	private String cv_type_str;
	private String cv_status_str;
	private String cv_from_str;
	private String degree_str;
	private String comment;

	private String cvTag;
	private String cvFlLevel;
	private String nationality;  //国籍
	
	/*
	 * 为了方便导入选 -联系记录 临时增加
	 * 
	 **/
	/**要加入的SL*/
	private Integer  projectId = 0;
	/**联系记录*/
	private String contactContext;
	
	
	public Integer getProjectId() {
		return projectId;
	}


	public void setProjectId(Integer projectId) {
		this.projectId = projectId;
	}


	public String getContactContext() {
		return contactContext;
	}


	public void setContactContext(String contactContext) {
		this.contactContext = contactContext;
	}


	public String getNationality() {
		return nationality;
	}

	public void setNationality(String nationality) {
		this.nationality = nationality;
	}

	public String getCvTag() {
		return cvTag;
	}

	public void setCvTag(String cvTag) {
		this.cvTag = cvTag;
	}

	public String getCvFlLevel() {
		return cvFlLevel;
	}

	public void setCvFlLevel(String cvFlLevel) {
		this.cvFlLevel = cvFlLevel;
	}

	private String resumeCreator;
	public String getResumeCreator() {
		return resumeCreator;
	}

	public void setResumeCreator(String resumeCreator) {
		this.resumeCreator = resumeCreator;
	}

	public Integer getCompanyId() {
		return companyId;
	}

	public void setCompanyId(Integer companyId) {
		this.companyId = companyId;
	}

	public Integer getOldcompanyId() {
		return oldcompanyId;
	}

	public void setOldcompanyId(Integer oldcompanyId) {
		this.oldcompanyId = oldcompanyId;
	}

	private Integer companyId;
	private Integer oldcompanyId;
	public Cv(){
	}

	public Cv(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setCvName(java.lang.String value) {
		this.cvName = value;
	}
	
	public java.lang.String getCvName() {
		return this.cvName;
	}
	public void setCvNameEn(java.lang.String value) {
		this.cvNameEn = value;
	}
	
	public java.lang.String getCvNameEn() {
		return this.cvNameEn;
	}
	public void setNameInformer(java.lang.String value) {
		this.nameInformer = value;
	}
	
	public java.lang.String getNameInformer() {
		return this.nameInformer;
	}
	public String getNameDtString() {
		return DateConvertUtils.format(getNameDt(), FORMAT_NAME_DT);
	}
	public void setNameDtString(String value) {
		setNameDt(DateConvertUtils.parse(value, FORMAT_NAME_DT,java.util.Date.class));
	}
	
	public void setNameDt(java.util.Date value) {
		this.nameDt = value;
	}
	
	public java.util.Date getNameDt() {
		return this.nameDt;
	}
	public void setSex(java.lang.String value) {
		this.sex = value;
	}
	
	public java.lang.String getSex() {
		return this.sex;
	}
	public String getBirthdayString() {
		return DateConvertUtils.format(getBirthday(), FORMAT_BIRTHDAY);
	}
	public void setBirthdayString(String value) {
		setBirthday(DateConvertUtils.parse(value, FORMAT_BIRTHDAY,java.util.Date.class));
	}
	
	public void setBirthday(java.util.Date value) {
		this.birthday = value;
	}
	
	public java.util.Date getBirthday() {
		return this.birthday;
	}
	
	
    public java.lang.String getLogo() {
		return logo;
	}

	public void setLogo(java.lang.String logo) {
		this.logo = logo;
	}

	public void setMobile(java.lang.String value) {
		this.mobile = value;
	}
	
	public java.lang.String getMobile() {
		return this.mobile;
	}
	public void setTel(java.lang.String value) {
		this.tel = value;
	}
	
	public java.lang.String getTel() {
		return this.tel;
	}
	public void setIm(java.lang.String value) {
		this.im = value;
	}
	
	public java.lang.String getIm() {
		return this.im;
	}
	public void setEmail(java.lang.String value) {
		this.email = value;
	}
	
	public java.lang.String getEmail() {
		return this.email;
	}
	public void setCompany(java.lang.String value) {
		this.company = value;
	}
	
	public java.lang.String getCompany() {
		return this.company;
	}
	public void setDept(java.lang.String value) {
		this.dept = value;
	}
	
	public java.lang.String getDept() {
		return this.dept;
	}
	public void setTitle(java.lang.String value) {
		this.title = value;
	}
	
	public java.lang.String getTitle() {
		return this.title;
	}
	public void setIndustry(java.lang.Integer value) {
		this.industry = value;
	}
	
	public java.lang.Integer getIndustry() {
		return this.industry;
	}
	public void setFunction(java.lang.Integer value) {
		this.function = value;
	}
	
	public java.lang.Integer getFunction() {
		return this.function;
	}
	public void setLevel(java.lang.Integer value) {
		this.level = value;
	}
	
	public java.lang.Integer getLevel() {
		return this.level;
	}
	public void setMarried(Integer value) {
		this.married = value;
	}
	
	public Integer getMarried() {
		return this.married;
	}
	public void setRegisterLocation(java.lang.Integer value) {
		this.registerLocation = value;
	}
	
	public java.lang.Integer getRegisterLocation() {
		return this.registerLocation;
	}
	public void setAddress(java.lang.String value) {
		this.address = value;
	}
	
	public java.lang.String getAddress() {
		return this.address;
	}
	public void setPostCode(java.lang.String value) {
		this.postCode = value;
	}
	
	public java.lang.String getPostCode() {
		return this.postCode;
	}
	public void setDegree(java.lang.Integer value) {
		this.degree = value;
	}
	
	public java.lang.Integer getDegree() {
		return this.degree;
	}
	public void setWorkYear(Integer value) {
		this.workYear = value;
	}
	
	public Integer getWorkYear() {
		return this.workYear;
	}
	public void setHomeBack(java.lang.String value) {
		this.homeBack = value;
	}
	
	public java.lang.String getHomeBack() {
		return this.homeBack;
	}
	public void setInterestEn(java.lang.String value) {
		this.interestEn = value;
	}
	
	public java.lang.String getInterestEn() {
		return this.interestEn;
	}
	public void setInterest(java.lang.String value) {
		this.interest = value;
	}
	
	public java.lang.String getInterest() {
		return this.interest;
	}
	public void setExpectLocation(String value) {
		this.expectLocation = value;
	}
	
	public String getExpectLocation() {
		return this.expectLocation;
	}
	public void setResumeInformer(java.lang.String value) {
		this.resumeInformer = value;
	}
	
	public java.lang.String getResumeInformer() {
		return this.resumeInformer;
	}
	public String getResumeDtString() {
		return DateConvertUtils.format(getResumeDt(), FORMAT_RESUME_DT);
	}
	public void setResumeDtString(String value) {
		setResumeDt(DateConvertUtils.parse(value, FORMAT_RESUME_DT,java.util.Date.class));
	}
	
	public void setResumeDt(java.util.Date value) {
		this.resumeDt = value;
	}
	
	public java.util.Date getResumeDt() {
		return this.resumeDt;
	}
	public void setCvType(java.lang.String value) {
		this.cvType = value;
	}
	
	public java.lang.String getCvType() {
		return this.cvType;
	}
	public void setCvStatus(java.lang.String value) {
		this.cvStatus = value;
	}
	
	public java.lang.String getCvStatus() {
		return this.cvStatus;
	}
	public void setCvFrom(java.lang.String value) {
		this.cvFrom = value;
	}
	
	public java.lang.String getCvFrom() {
		return this.cvFrom;
	}
	public void setCreator(java.lang.String value) {
		this.creator = value;
	}
	
	public java.lang.String getCreator() {
		return this.creator;
	}
	public String getCreateDtString() {
		return DateConvertUtils.format(getCreateDt(), FORMAT_CREATE_DT);
	}
	public void setCreateDtString(String value) {
		setCreateDt(DateConvertUtils.parse(value, FORMAT_CREATE_DT,java.util.Date.class));
	}
	
	public void setCreateDt(java.util.Date value) {
		this.createDt = value;
	}
	
	public java.util.Date getCreateDt() {
		return this.createDt;
	}
	public void setModifier(java.lang.String value) {
		this.modifier = value;
	}
	
	public java.lang.String getModifier() {
		return this.modifier;
	}
	public String getModifiedDtString() {
		return DateConvertUtils.format(getModifiedDt(), FORMAT_MODIFIED_DT);
	}
	public void setModifiedDtString(String value) {
		setModifiedDt(DateConvertUtils.parse(value, FORMAT_MODIFIED_DT,java.util.Date.class));
	}
	
	public void setModifiedDt(java.util.Date value) {
		this.modifiedDt = value;
	}
	
	public java.util.Date getModifiedDt() {
		return this.modifiedDt;
	}
	public void setHomeBackEn(java.lang.String value) {
		this.homeBackEn = value;
	}
	
	public java.lang.String getHomeBackEn() {
		return this.homeBackEn;
	}
	
	

	public java.lang.String getCurrentAddress() {
		return currentAddress;
	}

	public void setCurrentAddress(java.lang.String currentAddress) {
		this.currentAddress = currentAddress;
	}
	
	

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public static String getTableAlias() {
		return TABLE_ALIAS;
	}

	public static String getAliasId() {
		return ALIAS_ID;
	}

	public static String getAliasCvName() {
		return ALIAS_CV_NAME;
	}

	public static String getAliasCvNameEn() {
		return ALIAS_CV_NAME_EN;
	}

	public static String getAliasNameInformer() {
		return ALIAS_NAME_INFORMER;
	}

	public static String getAliasNameDt() {
		return ALIAS_NAME_DT;
	}

	public static String getAliasSex() {
		return ALIAS_SEX;
	}

	public static String getAliasBirthday() {
		return ALIAS_BIRTHDAY;
	}

	public static String getAliasMobile() {
		return ALIAS_MOBILE;
	}

	public static String getAliasTel() {
		return ALIAS_TEL;
	}

	public static String getAliasIm() {
		return ALIAS_IM;
	}

	public static String getAliasEmail() {
		return ALIAS_EMAIL;
	}

	public static String getAliasCompany() {
		return ALIAS_COMPANY;
	}

	public static String getAliasOldcompany() {
		return ALIAS_OLDCOMPANY;
	}

	public static String getAliasDept() {
		return ALIAS_DEPT;
	}

	public static String getAliasTitle() {
		return ALIAS_TITLE;
	}

	public static String getAliasIndustry() {
		return ALIAS_INDUSTRY;
	}

	public static String getAliasFunction() {
		return ALIAS_FUNCTION;
	}

	public static String getAliasLevel() {
		return ALIAS_LEVEL;
	}

	public static String getAliasMarried() {
		return ALIAS_MARRIED;
	}

	public static String getAliasRegisterLocation() {
		return ALIAS_REGISTER_LOCATION;
	}

	public static String getAliasAddress() {
		return ALIAS_ADDRESS;
	}

	public static String getAliasPostCode() {
		return ALIAS_POST_CODE;
	}

	public static String getAliasDegree() {
		return ALIAS_DEGREE;
	}

	public static String getAliasWorkYear() {
		return ALIAS_WORK_YEAR;
	}

	public static String getAliasHomeBack() {
		return ALIAS_HOME_BACK;
	}

	public static String getAliasInterestEn() {
		return ALIAS_INTEREST_EN;
	}

	public static String getAliasInterest() {
		return ALIAS_INTEREST;
	}

	public static String getAliasExpectLocation() {
		return ALIAS_EXPECT_LOCATION;
	}

	public static String getAliasResumeInformer() {
		return ALIAS_RESUME_INFORMER;
	}

	public static String getAliasResumeDt() {
		return ALIAS_RESUME_DT;
	}

	public static String getAliasCvType() {
		return ALIAS_CV_TYPE;
	}

	public static String getAliasCvStatus() {
		return ALIAS_CV_STATUS;
	}

	public static String getAliasCvFrom() {
		return ALIAS_CV_FROM;
	}

	public static String getAliasCreator() {
		return ALIAS_CREATOR;
	}

	public static String getAliasCreateDt() {
		return ALIAS_CREATE_DT;
	}

	public static String getAliasModifier() {
		return ALIAS_MODIFIER;
	}

	public static String getAliasModifiedDt() {
		return ALIAS_MODIFIED_DT;
	}

	public static String getAliasHomeBackEn() {
		return ALIAS_HOME_BACK_EN;
	}

	public static String getAliasLogo() {
		return ALIAS_LOGO;
	}

	public static String getAliasCurrentAddress() {
		return ALIAS_CURRENT_ADDRESS;
	}

	public static String getFormatNameDt() {
		return FORMAT_NAME_DT;
	}

	public static String getFormatBirthday() {
		return FORMAT_BIRTHDAY;
	}

	public static String getFormatResumeDt() {
		return FORMAT_RESUME_DT;
	}

	public static String getFormatCreateDt() {
		return FORMAT_CREATE_DT;
	}

	public static String getFormatModifiedDt() {
		return FORMAT_MODIFIED_DT;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("CvName",getCvName())
			.append("CvNameEn",getCvNameEn())
			.append("NameInformer",getNameInformer())
			.append("NameDt",getNameDt())
			.append("Sex",getSex())
			.append("Birthday",getBirthday())
			.append("Mobile",getMobile())
			.append("Tel",getTel())
			.append("Im",getIm())
			.append("Email",getEmail())
			.append("Company",getCompany())
			.append("Dept",getDept())
			.append("Title",getTitle())
			.append("Industry",getIndustry())
			.append("Function",getFunction())
			.append("Level",getLevel())
			.append("Married",getMarried())
			.append("RegisterLocation",getRegisterLocation())
			.append("Address",getAddress())
			.append("PostCode",getPostCode())
			.append("Degree",getDegree())
			.append("WorkYear",getWorkYear())
			.append("HomeBack",getHomeBack())
			.append("InterestEn",getInterestEn())
			.append("Interest",getInterest())
			.append("ExpectLocation",getExpectLocation())
			.append("ResumeInformer",getResumeInformer())
			.append("ResumeDt",getResumeDt())
			.append("CvType",getCvType())
			.append("CvStatus",getCvStatus())
			.append("CvFrom",getCvFrom())
			.append("Creator",getCreator())
			.append("CreateDt",getCreateDt())
			.append("Modifier",getModifier())
			.append("ModifiedDt",getModifiedDt())
			.append("HomeBackEn",getHomeBackEn())
			.toString();
	}
	
	
	


	public String getIndustry_str() {
		return industry_str;
	}

	public void setIndustry_str(String industry_str) {
		this.industry_str = industry_str;
	}

	public String getFunction_str() {
		return function_str;
	}

	public void setFunction_str(String function_str) {
		this.function_str = function_str;
	}

	public String getMarried_str() {
		return married_str;
	}

	public void setMarried_str(String married_str) {
		this.married_str = married_str;
	}

	public String getSex_str() {
		return sex_str;
	}

	public void setSex_str(String sex_str) {
		this.sex_str = sex_str;
	}

	public String getCv_type_str() {
		return cv_type_str;
	}

	public void setCv_type_str(String cv_type_str) {
		this.cv_type_str = cv_type_str;
	}

	public String getCv_status_str() {
		return cv_status_str;
	}

	public void setCv_status_str(String cv_status_str) {
		this.cv_status_str = cv_status_str;
	}

	public String getCv_from_str() {
		return cv_from_str;
	}

	public void setCv_from_str(String cv_from_str) {
		this.cv_from_str = cv_from_str;
	}
	
	

	public String getDegree_str() {
		return degree_str;
	}

	public void setDegree_str(String degree_str) {
		this.degree_str = degree_str;
	}
	
	

	public java.lang.String getOldcompany() {
		return oldcompany;
	}

	public void setOldcompany(java.lang.String oldcompany) {
		this.oldcompany = oldcompany;
	}

	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Cv == false) return false;
		if(this == obj) return true;
		Cv other = (Cv)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

